﻿$(function () {
    //登录按钮绑定
    $("#LoginIn").click(function () {
        var userName = $("#UserName").val();
        var password = $("#Password").val();
        if (userName == "" || userName.trim() == "") {
            alert("请输入用户名");
            return false;
        }
        $.ajax({
            data: { userName: userName, password: password },
            type: "post",
            url: "/Login/LoginIn",
            success: function (datas) {
                var data = JSON.parse(datas);
                if (data.state == true)
                    window.location.href = "/User/Index";
            },
            error: function () {
                alert("登录异常");
            }
        });
    });
    //$("#regist").click(function () {

    //});
})